Carbon


DebuggerThreadSchedulerProcPtr

Header: Threads.h Carbon status: Supported

Defines a pointer to a thread scheduler debugging callback function. A thread scheduler debugging callback function is a debugging function that the Thread Manager calls whenever a thread is scheduled.

typedef ThreadID(* DebuggerThreadSchedulerProcPtr) (
    SchedulerInfoRecPtr schedulerInfo
);

You would declare your function like this if you were to name it MyDebuggerThreadSchedulerCallback:

ThreadID MyDebuggerThreadSchedulerCallback (
    SchedulerInfoRecPtr schedulerInfo
);
schedulerInfo

A pointer to a scheduler information structure that the SetDebuggerNotificationProcs function passes to the MyDebuggerThreadSchedulerProc function. Among other information, the scheduler information structure contains the ID of the current thread and the ID of the thread that the Thread Manager has scheduled to run next.

function result

Δ

DISCUSSION

The MyDebuggerThreadSchedulerProc function is one of three debugging functions that you can install with the SetDebuggerNotificationProcs function. The Thread Manager calls MyDebuggerThreadSchedulerProc whenever an application schedules a new thread to run. The MyDebuggerThreadSchedulerProc function gets the last look at the thread being scheduledóthat is, the Thread Manager calls this function after the Thread Manager default scheduling mechanism and a custom scheduler, if you have installed one, decide on the next thread to schedule.

If you wish, you can use this debugging callback function to schedule a different thread than that chosen by the Thread Manager and any custom scheduling function. The MyDebuggerThreadSchedulerProc returns the thread ID of the next thread to schedule. The MyDebuggerThreadSchedulerProc can specify kNoThreadID for the thread ID if you do not want to change the decision of the Thread Manager default scheduler or a custom scheduler.

To schedule a thread, use functions such as YieldToAnyThread, YieldToThread, and SetThreadState.

AVAILABILITY

Supported in Carbon.


© 2000 Apple Computer, Inc. — (Last Updated 3/8/2000)